package com.hoshiicloud.user.config;

import org.neo4j.driver.v1.AuthTokens;
import org.neo4j.driver.v1.Driver;
import org.neo4j.driver.v1.GraphDatabase;
import org.neo4j.driver.v1.Session;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
//@ConfigurationProperties(prefix = "neo4j")
public class Neo4jSourceConfig {

    //@Value("${spring.data.neo4j.uri}")
    private String uri;

    //@Value("${spring.data.neo4j.username}")
    private String username;

    //@Value("${spring.data.neo4j.password}")
    private String password;

    @Bean(name = "session")
    public Session neo4jSession() {
        //Driver driver = GraphDatabase.driver("bolt://114.115.220.240:7687", AuthTokens.basic("neo4j", "123456"));
        //图形测试数据库
        Driver driver = GraphDatabase.driver("bolt://192.168.192.13:7687", AuthTokens.basic("neo4j", "Neo4j@123456"));
        return driver.session();
    }
}
